home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / Clueless.swf / scripts / AchievementsList.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  2.4 KB  |  81 lines

  1. package
  2. {
  3.    import Forms.AchievementsPopupForm;
  4.    import Forms.BaseForm;
  5.    import Forms.CluelessBaseForm;
  6.    import Forms.DressupResultForm;
  7.    
  8.    public class AchievementsList
  9.    {
  10.       
  11.       public static const NUM_PARTNERS:int = 8;
  12.       
  13.       public static const PARTNER_MATCH_NUM:int = 40;
  14.       
  15.       public static const OCCASION_MATCH_NUM:int = 50;
  16.        
  17.       
  18.       public function AchievementsList()
  19.       {
  20.          super();
  21.       }
  22.       
  23.       public static function incrementOccasionGood(param1:String) : void
  24.       {
  25.          var _loc2_:Boolean = false;
  26.          _loc2_ = Profile.CurrentProfile.Achievements.incrementPairCounterLimit(param1,"TotalOccasionGoodMatches",OCCASION_MATCH_NUM);
  27.          if(_loc2_)
  28.          {
  29.             trace("Occasion match partner : " + param1);
  30.             showAchievement(param1.toLowerCase());
  31.          }
  32.       }
  33.       
  34.       public static function showAchievement(param1:String) : *
  35.       {
  36.          var _loc2_:AchievementsPopupForm = null;
  37.          var _loc3_:CluelessBaseForm = null;
  38.          _loc2_ = new AchievementsPopupForm();
  39.          _loc2_.init(param1);
  40.          _loc3_ = BaseForm.getCurrentForm() as CluelessBaseForm;
  41.          if(_loc3_ != null)
  42.          {
  43.             _loc3_.hideMouseCursor();
  44.          }
  45.          BaseForm.setForm(_loc2_,true);
  46.          Profile.CurrentProfile.Achievements.incrementPairCounter(param1,"Unlocked");
  47.       }
  48.       
  49.       public static function checkAffinities() : void
  50.       {
  51.          var _loc1_:Boolean = false;
  52.          var _loc2_:Partner = null;
  53.          _loc1_ = true;
  54.          for each(_loc2_ in Database.getInstance().Partners)
  55.          {
  56.             if(Profile.CurrentProfile.Affinities.getPairCounter(_loc2_.TargetModel,_loc2_.Name) < DressupResultForm.PARTNER_CUTSCENE_2)
  57.             {
  58.                _loc1_ = false;
  59.                break;
  60.             }
  61.          }
  62.          if(_loc1_)
  63.          {
  64.             showAchievement("golden");
  65.          }
  66.       }
  67.       
  68.       public static function incrementPerfect(param1:String) : void
  69.       {
  70.          var _loc2_:Boolean = false;
  71.          var _loc3_:int = 0;
  72.          _loc3_ = PARTNER_MATCH_NUM;
  73.          _loc2_ = Profile.CurrentProfile.Achievements.incrementPairCounterLimit(param1,"TotalPerfectMatches",_loc3_);
  74.          if(_loc2_)
  75.          {
  76.             showAchievement(param1.toLowerCase());
  77.          }
  78.       }
  79.    }
  80. }
  81.